<template>
	<view class="wrap">
		<view class="article-title">{{banner.title}}</view>
		<view class="article-meta">
			{{banner.sendUserName}} 发起于 {{banner.planPushDate}}</text>
		</view>
		<view class="article-content ss">
			<rich-text :nodes="content" class="ss"></rich-text>
		</view>
		<button v-if="flag" @click="clickDetail()">查看详情</button>
		<view class="u-p-t-5"></view>
	</view>
</template>
<script>
/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
export default {
	
	data() {
		return {
			ID:'',
			banner: {
				title: '',
				sendUserName: '',
				planPushDate: ''
			},
			content: '',
			flag:false,
			bizKey:''
		};
	},
	
	onLoad(option) {
		this.ID=option.id
		if(this.ID){
			this.getDeail()
		}
		
	},
	methods: {
		clickDetail(){
				uni.navigateTo({
					url: "detail?id="+this.bizKey
				});
		},
		getDeail(){
			var _this=this;
			_this.$u.api.message.readMsg({ id: _this.ID }).then((res) => {
				_this.bizKey = res.msgPush.bizKey
				_this.banner.title=res.msgPush.msgTitle;
				_this.banner.sendUserName=res.msgPush.sendUserName;
				_this.banner.planPushDate=res.msgPush.planPushDate;
				_this.content=res.msgPush.msgContentEntity.content;
				if(res.msgPush.msgContentEntity.content&&(res.msgPush.msgContentEntity.content).indexOf("点击“详情”进行查阅。")!=-1){
					_this.flag=true
				}
			});
		}
	}
};
</script>
<style lang="scss">
page {
	background-color: #f8f8f8;
}
.article-title {
	font-size: 38rpx;
	font-weight: 400;
	text-align: center;
	padding-bottom: 30rpx;
	margin: 30rpx;
	border-bottom: 1px solid #c0c4cb;
	color: #51a0d5;
}
.article-meta {
	padding: 10rpx 50upx 30rpx;
	color: gray;
}
.article-content {
	padding: 0 30upx;
	overflow: hidden;
	font-size: 30rpx;
	line-height: 50rpx;
	margin-bottom: 30rpx;
	text-indent: 60rpx;
	/deep/ p {
		margin-bottom: 20rpx;
	}
}
.ss{

	word-wrap: break-word;
	overflow: hidden;
}
.u-cell{
	display: block!important;
}
</style>
